#!/bin/sh

CONF_FILE="/yi-hack-v3/etc/system.conf"

if [ -d "/usr/yi-hack-v3" ]; then
        YI_HACK_V3_PREFIX="/usr"
elif [ -d "/home/yi-hack-v3" ]; then
        YI_HACK_V3_PREFIX="/home"
fi

get_config()
{
	key=$1
	grep $1 $YI_HACK_V3_PREFIX$CONF_FILE | cut -d "=" -f2
}
                
if [[ $(get_config PROXYCHAINSNG) == "yes" ]] ; then
	$YI_HACK_V3_PREFIX/yi-hack-v3/bin/proxychains4 ./cloudAPI_real "$@"
else
	./cloudAPI_real "$@"
fi

